package huawei.js2025;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;

/**
 * 计算最多能观看几场演出
 */
public class Question33 {

    public static class ShowTime implements Comparable<ShowTime>{
        int start;
        int end;

        public ShowTime(int start, int end) {
            this.start = start;
            this.end = end;
        }

        @Override
        public int compareTo(ShowTime o) {
            return this.start - o.start;
        }
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();

        List<ShowTime> list = new ArrayList<>();
        for (int i = 0; i < N; i++) {
            int start = sc.nextInt();
            int end = start + sc.nextInt();
            list.add(new ShowTime(start, end));
        }

        // 排序
        Collections.sort(list);

        List<Integer> contains = new ArrayList<>();

        for (int i = 0; i < list.size(); i++) {
            ShowTime showTime1 = list.get(i);
            for (int j = i + 1; j < list.size(); j++) {
                ShowTime showTime2 = list.get(j);
                if (showTime1.end >= showTime2.end) {
                    contains.add(j);
                    break;
                }
            }
        }

        for (int i = 0; i < contains.size(); i++) {
            list.remove(i);
        }

        int count = 1;
        int now = list.get(0).end + 15;

        for (int i = 1; i < list.size(); i++) {
            if (now <= list.get(i).start) {
                count++;
                now = list.get(i).end + 15;
            }
        }

        System.out.println(count);
    }
}
